#include <iostream>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
	int i,j,n,s,sum,a;
	s=1;
	a=1;
	sum=0;
	scanf("%d",&n);
	for( i=1;i<=n;i++){
		for(int j=1;j<=i;j++){
		a=a*j;
		}
			sum=sum+a;
			a=1;
	}
	printf("%d",sum);
	return 0;
}
